package routes

import (
	"github.com/kataras/iris/v12"
	"ir/controllers/api"
	"ir/middlewares"
)

func ApiRoutes(app *iris.Application) {
	apiParty := app.Party(
		"/api",
		middlewares.CorsMiddleware(), //跨域中间件
	).AllowMethods(iris.MethodOptions)
	apiParty.Get("/ping", api.Bar)
	apiParty.Get("/test", api.Test)
	apiParty.Get("/test/kafka", api.TestKafka)
	apiParty.Get("/test/match", api.MatchTest)
	apiParty.Get("/subpub", api.SubPub)

	apiParty.Get("/redisPublish", api.RedisPublish)
	apiParty.Get("/redis/list/one", api.GetListOne)
	apiParty.Post("/order/create", api.HandleOrder)
	apiParty.Post("/order/cancel", api.HandleOrder)

}
